<%--
  Created by IntelliJ IDEA.
  User: Hexun
  Date: 2017/8/1 0001
  Time: 15:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>体校考试系统</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="icon" type="image/png" href="/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
    <link rel="stylesheet" href="/assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="/assets/css/admin.css">
    <link rel="stylesheet" href="/assets/css/app.css">
    <script src="/assets/js/jquery.min.js"></script>
    <script language="JavaScript">
        function yuejuan(lii) {
            if (lii == 1) {
                var url = "/yuejuan/yijianyuejuan?" + "yj=" + 1;
            } else {
                var courseName = lii.innerText;
                var url = "/yuejuan/yijianyuejuan?sclass=" + courseName + "&yj=" + 0;
            }

            url = encodeURI(encodeURI(url));
            window.location.href = url;
        }

        function getcourse(co) {
            var courses = co.innerText;
            var url = "/yuejuan/GetScore?getcourses=" + courses;
            url = encodeURI(encodeURI(url));
            window.location.href = url;
        }

        function Absent() {
            var url = "/yuejuan/Absent";
            url = encodeURI(encodeURI(url));
            window.location.href = url;
        }
    </script>
</head>
<body>
<%@ include file="/NavMenu.jsp" %>
<div style="float: left;margin-left: 2%;width: 76%">
    <div class="tpl-portlet-components">
        <div class="portlet-title">
            <div class="caption font-green bold" style="width: 100%;">
                <span class="am-icon-code"></span> 试卷分配
            </div>
        </div>
        <div class="tpl-block">
            <div>
                <button class="am-btn-primary am-btn" onclick="Absent()">导出缺考</button>
                <div class="am-dropdown" data-am-dropdown style="float: right">
                    <button class="am-btn am-btn-primary am-dropdown-toggle" data-am-dropdown-toggle>一键阅卷 <span
                            class="am-icon-caret-down"></span></button>
                    <ul class="am-dropdown-content" id="course_name" name="Course_name">
                        <li value="1" onclick="yuejuan(1)">全部阅卷</li>
                        <c:forEach var="name" items="${coures_name}">
                            <li value="${name}" onclick="yuejuan(this)">${name}</li>
                        </c:forEach>
                    </ul>
                </div>
                <div class="am-dropdown" data-am-dropdown style="float: right;margin-right: 10px;">
                    <button class="am-btn am-btn-primary am-dropdown-toggle" data-am-dropdown-toggle>成绩导出 <span
                            class="am-icon-caret-down"></span></button>
                    <ul class="am-dropdown-content" id="getcourse" name="Getcourse">
                        <c:forEach var="name" items="${getcourse}">
                            <li value="${name}" onclick="getcourse(this)">${name}</li>
                        </c:forEach>
                    </ul>
                </div>
            </div>

            <div>
                <form method="post" action="/yuejuan/SeachScore">
                    <table class="am-table  am-table-hover am-text-center table-main ">
                        <tr>
                            <td>
                                科目:<select name="courses_n">
                                <c:forEach var="name" items="${getcourse}">
                                    <option value="${name}" name="course_n">${name}</option>
                                </c:forEach>
                            </select>
                            </td>
                            <td>
                                年级：<input type="text" name="sclass1">
                            </td>
                            <td>
                                考号：<input type="text" name="stno">
                            </td>
                            <td>
                                姓名：<input type="text" name="stname">
                            </td>
                            <td>
                                <input type="submit" value="查询">
                            </td>
                        </tr>
                    </table>
                </form>

                <!--查询后方显示分数-->
                <table class="am-table  am-table-hover am-text-center table-main ">
                    <tr>
                        <td>考号</td>
                        <td>单位室队</td>
                        <td>姓名</td>
                        <td>总分</td>
                    </tr>
                    <c:forEach items="${Page.list}" varStatus="num" var="stu">
                        <tr id="tr${num.index}" align="center">
                            <td width="4%">${stu.studentno}</td>
                            <td width="10%">${stu.sclass}</td>
                            <td width="10%">${stu.name}</td>
                            <td width="4%" id="op">${stu.Allscore}</td>
                        </tr>
                    </c:forEach>
                </table>

                <!--分页-->
                <ul class="am-pagination am-pagination-centered">
                    <c:choose>
                        <c:when test="${Page.totalPage>0}">
                            <li><a href="${pageurl}&page=1">共${Page.totalPage}页</a></li>
                            <li><a href="${pageurl}&page=1">首页</a></li>
                            <c:choose>
                                <c:when test="${Page.pageNumber >1}">
                                    <li><a href="${pageurl}&page=${Page.pageNumber-1}">&laquo;</a></li>
                                </c:when>
                            </c:choose>

                            <li class="am-active"><a href="#">${Page.pageNumber}</a></li>
                            <c:choose>
                                <c:when test="${Page.pageNumber <Page.totalPage}">
                                    <li><a href="${pageurl}&page=${Page.pageNumber+1}">&raquo;</a></li>
                                </c:when>
                            </c:choose>

                            <li><a href="${pageurl}&page=${Page.totalPage}">尾页</a></li>
                        </c:when>
                        <c:otherwise>
                            <li>当前条件无记录</li>
                        </c:otherwise>
                    </c:choose>
                </ul>
            </div>
        </div>
    </div>

</div>
</body>
</html>
